from UserManageDao import UserManageDao
from ElectronicAssetDAO import ElectronicAssetDAO
class UserManageService:
    @staticmethod
    def add_user(**kwargs):
        return UserManageDao.add_user(**kwargs)

    @staticmethod
    def del_user(user_uuid):
        asset_count =  len(ElectronicAssetDAO.get_user_devices(user_uuid))
        if asset_count==0:
            UserManageDao.del_user(user_uuid)
            return True
        else:
            return False


    @staticmethod
    def get_user(user_uuid):
        return UserManageDao.get_user(user_uuid)


